import sys
import os


fd1 = open("result1", "r")
fd2 = open("result2", "r")
fd3 = open("result3", "r")
fd4 = open("result4", "r")
fd5 = open("result5", "r")

fdout = open("result_final", "w")

lines1 = fd1.readlines()
lines2 = fd2.readlines()
lines3 = fd3.readlines()
lines4 = fd4.readlines()
lines5 = fd5.readlines()


total = 0
moyenne = 0
for i in range(1, 21):
    total = float(lines1.pop(0).replace("\n", "")) + float(lines2.pop(0).replace("\n", "")) + float(lines3.pop(0).replace("\n", "")) + float(lines4.pop(0).replace("\n", "")) + float(lines5.pop(0).replace("\n", ""))

    moyenne = total/5
    fdout.writelines(str(i)+" "+str(moyenne)+"\n")
